package com.scyshkj.university.wechat.wanxiao;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.scyshkj.university.wechat.utils.ParameterToMap;
import com.scyshkj.university.wechat.utils.RandomStringUtil;
import com.scyshkj.university.wechat.utils.UuidGenerator;
import lombok.Data;

import java.math.BigDecimal;

/**
 * Created by 唐旭 on 2016/11/22.
 */
@Data
public class PayApplyRequestParameter implements ParameterToMap {
    @JsonIgnore
    private String accessToken;

    @JsonProperty("app_Id")
    private int appId;

    @JsonProperty("pay_code")
    private String payCode;

    @JsonProperty("apply_id")
    private String applyId;

    @JsonProperty("apply_amount")
    private BigDecimal applyAmount;

    private String type = "40";
    //随机字符串
    @JsonProperty("norce_str")
    private String norceStr = UuidGenerator.generate();

    public PayApplyRequestParameter() {
    }

    public PayApplyRequestParameter(WanxiaoProperties properties, BigDecimal amount) {
        this.appId = properties.getAppId();
        this.payCode = properties.getPayCode();
        this.applyId = RandomStringUtil.getRandomString(24);
        this.applyAmount = amount;
    }
}
